"""
商品 序列化器

"""

from rest_framework import serializers
from goods import models


class GoodsGroupSerializer(serializers.ModelSerializer):
    """ 商品分类序列化器 """

    class Meta:
        model = models.GoodsGroup
        fields = ['id', 'name', 'image', 'status']


class GoodsSerializer(serializers.ModelSerializer):
    """ 商品序列化器 """

    class Meta:
        model = models.Goods
        exclude = ['create_time', 'update_time', 'is_delete']


class GoodsBannerSerializer(serializers.ModelSerializer):
    """ 商品轮播图序列化器 """

    class Meta:
        model = models.GoodsBanner
        fields = '__all__'


class DetailSerializer(serializers.ModelSerializer):
    """ 商品详细序列化器 """

    class Meta:
        model = models.Detail
        exclude = ['create_time', 'update_time', 'is_delete']


class CollectSerializer(serializers.ModelSerializer):
    """ 商品收藏序列化器 """

    class Meta:
        model = models.Collect
        fields = '__all__'
